home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tk8.0 / tests / event.test < prev    next >
Encoding:
Text File  |  1997-08-15  |  1006 b   |  42 lines  |  [TEXT/ALFA]

  1. # This file is a Tcl script to test the code in tkEvent.c.  It is
  2. # organized in the standard fashion for Tcl tests.
  3. #
  4. # Copyright (c) 1994 The Regents of the University of California.
  5. # Copyright (c) 1994-1995 Sun Microsystems, Inc.
  6. #
  7. # See the file "license.terms" for information on usage and redistribution
  8. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  9. #
  10. # SCCS: @(#) event.test 1.6 96/09/12 09:25:44
  11.  
  12. if {[info procs test] != "test"} {
  13.     source defs
  14. }
  15.  
  16. foreach i [winfo children .] {
  17.     destroy $i
  18. }
  19. wm geometry . {}
  20. raise .
  21.  
  22. # XXX This test file is woefully incomplete.  Right now it only tests
  23. # a few of the procedures in tkEvent.c.  Please add more tests whenever
  24. # possible.
  25.  
  26. test event-1.1 {Tk_HandleEvent procedure, filter events for dead windows} {
  27.     button .b -text Test
  28.     pack .b
  29.     bindtags .b .b
  30.     update
  31.     bind .b <Destroy> {
  32.     lappend x destroy
  33.     event generate .b <1>
  34.     }
  35.     bind .b <1> {
  36.     lappend x button
  37.     }
  38.     set x {}
  39.     destroy .b
  40.     set x
  41. } {destroy}
  42.